<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="brand" href="#">Protoweb</a>

        <ul class="nav">
          {if ! isset($user->id)}
          <li><a href="users/login/">Login</a></li>
          {else}
          <li><a href="users/dashboard/">Home</a></li>
          {/if}

          {if isset($project->id)}
          <li class="divider-vertical"></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">{$project->name} <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="projects/dashboard/{$project->id}/">Project Dashboard</a></li>
              <li><a data-toggle="modal" data-target="#entities_create" href="entities/create/{$project->id}/">Create Entity</a></li>
              <li class="divider"></li>
              <li><a href="projects/{$project->slug}/" target="pw-test">Test in new Windows</a></li>
              <li class="divider"></li>
              <li><a href='projects/edit/{$project->id}/'>Basic settings</a></li>
              <li><a href='projects/members/{$project->id}/'>Edit members</a></li>
            </ul>
          </li>
          {/if}
        </ul>
        <!-- left menu -->

        <!-- Save for action -->
        {if isset($startLine)}
          <button id="save-action" class="btn" title="Save Changes"><i class="icon-ok-sign"></i> Save Controller</button> 
        {/if}

        {if isset($view)}
          <div class="btn-group pull-left">
            <a id="toogle-design" class="btn" title="Toggle to Design"><i class="icon-th-large"></i></a> 
            <a id="toogle-code" class="btn" title="Toggle to Code"><i class="icon-align-left"></i></a> 
            <a id="save-template" class="btn" title="Save Changes"><i class="icon-ok-sign"></i></a> 
            <a id="compile-template" class="btn" title="Generate View"><i class="icon-thumbs-up"></i></a>
          </div>
          <div class="btn-group pull-left">
            <a id="delete-view" class="btn" title="Delete View" href="views/delete/{$entity->id}/{$view}/"><i class="icon-trash"></i></a>
          </div>
        {/if}

        <ul class="nav pull-right">
          {if isset($user->id)}
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">{$user->firstname} <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="users/edit/">Profile</a></li>
              <li><a href="users/logout/">Logout</a></li>
            </ul>
          </li>
          {else}
          <li><a href="users/signup/">Sign Up</a></li>
          {/if}

          <li class="divider-vertical"></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Language <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#">English</a></li>
              <li><a href="#">Español</a></li>
            </ul>
          </li>
        </ul>
        <!-- right menu -->

    </div>
  </div>
</nav>
